/**
 * 
 */
package com.rocky.project.action.report;

import com.opensymphony.webwork.ServletActionContext;
import com.rocky.project.model.family.Attachment;

/**
 * @author chen
 * 从附件类型来初始化VO对象
 */
public class AttachmentVO {
	
	private String title;
	
	private String path;
	
	private String size;
	
	private String fileName;
	
	private String type;
	
	public void initAttachment(Attachment att)
	{
		this.title=att.getName();
		
		//this.path=att.getRelativePath();//转换成绝对路径
		this.path=ServletActionContext.getServletContext().getRealPath(att.getRelativePath());
		this.size=att.getSize().toString();
		this.fileName=att.getDisplayName();
		String  i=att.getType();
		if("1".equals(i))
		{
			this.type="照片";
		}
		else if("2".equals(i))
		{
			this.type="图纸";
		}
		else if("3".equals(i))
		{
			this.type="历史档案";
		}
		else if("4".equals(i))
		{
			this.type="备注文档";
		}
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

}
